package top.goldenyear.porpoise.framework.web.core.generator.enums;

import static cn.hutool.v7.core.array.ArrayUtil.firstMatch;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 代码生成的场景枚举
 *
 * @author airhead
 */
@AllArgsConstructor
@Getter
public enum Scene {
  /** 应用场景 */
  ADMIN(1, "管理后台", "admin", ""),
  APP(2, "用户 APP", "app", "App");

  /** 场景 */
  private final Integer value;

  /** 场景名 */
  private final String name;

  /** 基础包名 */
  private final String basePackage;

  /** Controller 和 VO 类的前缀 */
  private final String prefixClass;

  public static Scene valueOf(Integer scene) {
    return firstMatch(sceneEnum -> sceneEnum.getValue().equals(scene), values());
  }
}
